package org.batatasframework.support.event;

import org.batatasframework.support.database.AliasGenerator;
import org.batatasframework.support.database.IdentifyTableGenerator;
import org.batatasframework.support.database.TableInfo;
import org.batatasframework.support.database.jdbc.ConnectionAccessor;
import org.batatasframework.support.database.sql.TableInstance;
import org.batatasframework.support.database.sql.spi.TableCriterion;
import org.batatasframework.support.searchable.SearchableInputStream;

import cn.bonoon.kernel.support.IOperator;

/**
 * <pre>
 * 执行查询操作时所需要参数配置；主要包括：
 * 1. [重要]当前操作者(参考：{@link IOperator})
 * 2. [重要]数据库访问器(参考：{@link ConnectionAccessor})
 * 3. [重要]需要被查询的数据库表的定义信息(不一定是查询的目标表，因为有分表的情况，
 *           需要根据当前用户的信息来决定查询哪个数据库表)
 * 4. [可选]查询目标表的生成器(参考：{@link IdentifyTableGenerator})
 * 5. [可选]别名生成器(参考：{@link AliasGenerator})
 * </pre>
 * @author jackson
 * @see TableInfo
 */
public interface SearchableRequest extends BaseRequest{
	
	IdentifyTableGenerator getTableObjectGenerator();
	void setTableObjectGenerator(IdentifyTableGenerator tableObjectGenerator);
	
	AliasGenerator getAliasGenerator();
	void setAliasGenerator(AliasGenerator aliasGenerator);
	
	//这个方法不一定在这里
	void resolve(TableInstance tableInstance, TableCriterion tableCriterion) throws Exception;
	
	SearchableInputStream getInputStream();
	void setInputStream(SearchableInputStream inputStream);
}
